//
//  DesignAllCell.m
//  ForestPack
//
//  Created by jimmy on 2018/7/9.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "DesignAllCell.h"
#import "Masonry.h"

#pragma mark - 设计师的cell
@implementation DesignAllCell

+ (DesignAllCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellID = @"DesignAllCell";
    DesignAllCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[DesignAllCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        [cell createSubView];
    }
    
    return cell;
}

- (void)createSubView
{
    UIImageView *titleImage = [[UIImageView alloc] init];
    titleImage.image = [UIImage imageNamed:@"商品背景图"];
    titleImage.layer.masksToBounds = YES;
    titleImage.layer.cornerRadius = 81/2;
    [self addSubview:titleImage];
    [titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(15);
        make.left.equalTo(self.mas_left).offset(13);
        make.width.equalTo(@81);
        make.height.equalTo(@81);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.text = @"森林包装品牌设计";
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.numberOfLines = 0;
    titleLabel.font = Kfont(14);
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(15);
        make.right.equalTo(self.mas_right).offset(-30);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.height.equalTo(@15);
    }];
    
    UILabel *tag1 = [[UILabel alloc] init];
    tag1.text = @"个人";
    tag1.textAlignment = NSTextAlignmentCenter;
    tag1.layer.masksToBounds = YES;
    tag1.layer.cornerRadius = 15/2;
    tag1.layer.borderWidth = 0.5;
    tag1.layer.borderColor = RGB_COLOR(237,34,59).CGColor;
    tag1.textColor = RGB_COLOR(237,34,59);
    tag1.numberOfLines = 0;
    tag1.font = Kfont(10);
    [self addSubview:tag1];
    [tag1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(5);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.width.equalTo(@40);
        make.height.equalTo(@15);
    }];
    
    UILabel *tag2 = [[UILabel alloc] init];
    tag2.text = @"LOGO";
    tag2.textAlignment = NSTextAlignmentCenter;
    tag2.layer.masksToBounds = YES;
    tag2.layer.cornerRadius = 15/2;
    tag2.layer.borderWidth = 0.5;
    tag2.layer.borderColor = RGB_COLOR(237,34,59).CGColor;
    tag2.textColor = RGB_COLOR(237,34,59);
    tag2.numberOfLines = 0;
    tag2.font = Kfont(10);
    [self addSubview:tag2];
    [tag2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(5);
        make.left.equalTo(tag1.mas_right).offset(5);
        make.width.equalTo(@50);
        make.height.equalTo(@15);
    }];
    
    UILabel *tag3 = [[UILabel alloc] init];
    tag3.text = @"森林包装";
    tag3.textAlignment = NSTextAlignmentCenter;
    tag3.layer.masksToBounds = YES;
    tag3.layer.cornerRadius = 15/2;
    tag3.layer.borderWidth = 0.5;
    tag3.layer.borderColor = RGB_COLOR(237,34,59).CGColor;
    tag3.textColor = RGB_COLOR(237,34,59);
    tag3.numberOfLines = 0;
    tag3.font = Kfont(10);
    [self addSubview:tag3];
    [tag3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(5);
        make.left.equalTo(tag2.mas_right).offset(5);
        make.width.equalTo(@60);
        make.height.equalTo(@15);
    }];
    
    UILabel *detailLabel = [[UILabel alloc] init];
    detailLabel.text = @"成交2243笔 | 服务评分：4.98分 | 15km";
    detailLabel.textColor = RGB_COLOR(153,153,153);
    detailLabel.numberOfLines = 0;
    detailLabel.font = Kfont(12);
    [self addSubview:detailLabel];
    [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(tag1.mas_bottom).offset(5);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.right.equalTo(self.mas_right).offset(-20);
        make.height.equalTo(@15);
    }];
    
    UILabel *tagLabel = [[UILabel alloc] init];
    tagLabel.text = @"服务";
    tagLabel.textAlignment = NSTextAlignmentCenter;
    tagLabel.layer.masksToBounds = YES;
    tagLabel.layer.cornerRadius = 15/2;
    tagLabel.layer.borderWidth = 0.5;
    tagLabel.layer.borderColor = RGB_COLOR(237,34,59).CGColor;
    tagLabel.textColor = RGB_COLOR(237,34,59);
    tagLabel.numberOfLines = 0;
    tagLabel.font = Kfont(10);
    [self addSubview:tagLabel];
    [tagLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(detailLabel.mas_bottom).offset(5);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.width.equalTo(@40);
        make.height.equalTo(@15);
    }];
    
    UILabel *nameLabel = [[UILabel alloc] init];
    nameLabel.text = @"LOGO包装设计...";
    nameLabel.textColor = RGB_COLOR(237,34,59);
    nameLabel.numberOfLines = 0;
    nameLabel.font = Kfont(12);
    [self addSubview:nameLabel];
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(detailLabel.mas_bottom).offset(5);
        make.left.equalTo(tagLabel.mas_right).offset(5);
        make.width.equalTo(@150);
        make.height.equalTo(@15);
    }];
    
    UILabel *priceLabel = [[UILabel alloc] init];
    priceLabel.text = @"1200元";
    priceLabel.textAlignment = NSTextAlignmentRight;
    priceLabel.textColor = RGB_COLOR(237,34,59);
    priceLabel.font = Kfont(14);
    [self addSubview:priceLabel];
    [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mas_bottom).offset(-15);
        make.right.equalTo(self.mas_right).offset(-10);
        make.width.equalTo(@70);
        make.height.equalTo(@15);
    }];
    
}

@end

#pragma mark - 商品的cell
@interface CommoditynCell()


@end

@implementation CommoditynCell

+ (CommoditynCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellID = @"CommoditynCell";
    CommoditynCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[CommoditynCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        [cell createSubView];
    }
    
    return cell;
}

- (void)createSubView
{
    UIImageView *titleImage = [[UIImageView alloc] init];
    titleImage.image = [UIImage imageNamed:@"商品背景图"];
    [self addSubview:titleImage];
    [titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(15);
        make.left.equalTo(self.mas_left).offset(13);
        make.width.equalTo(@103);
        make.height.equalTo(@71);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText:@"公司包装设计 / 商标设计 / LOGO设计"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.numberOfLines = 0;
    titleLabel.font = Kfont(14);
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(15);
        make.right.equalTo(self.mas_right).offset(-30);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.height.equalTo(@15);
    }];
    
    UILabel *detailLabel = [[UILabel alloc] init];
    detailLabel.text = @"成交2243笔 | 服务评分：4.98分 | 15km";
    detailLabel.textColor = RGB_COLOR(153,153,153);
    detailLabel.numberOfLines = 0;
    detailLabel.font = Kfont(12);
    [self addSubview:detailLabel];
    [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(5);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.right.equalTo(self.mas_right).offset(-20);
        make.height.equalTo(@15);
    }];
    
    UILabel *nameLabel = [[UILabel alloc] init];
    nameLabel.text = @"森林包装设计";
    nameLabel.textColor = FONTCOLOR_BLACK;
    nameLabel.numberOfLines = 0;
    nameLabel.font = Kfont(12);
    [self addSubview:nameLabel];
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(detailLabel.mas_bottom).offset(24);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.width.equalTo(@150);
        make.height.equalTo(@15);
    }];
    
    UILabel *priceLabel = [[UILabel alloc] init];
    priceLabel.text = @"1200元";
    priceLabel.textAlignment = NSTextAlignmentRight;
    priceLabel.textColor = RGB_COLOR(237,34,59);
    priceLabel.font = Kfont(14);
    [self addSubview:priceLabel];
    [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mas_bottom).offset(-15);
        make.right.equalTo(self.mas_right).offset(-10);
        make.width.equalTo(@70);
        make.height.equalTo(@15);
    }];
    
}

@end


#pragma mark - 创意空间的cell
@interface CreativeCell ()




@end

@implementation CreativeCell

+ (CreativeCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellID = @"CreativeCell";
    CreativeCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[CreativeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        [cell createSubView];
    }
    
    return cell;
}

- (void)createSubView
{
    UIImageView *titleImage = [[UIImageView alloc] init];
    titleImage.image = [UIImage imageNamed:@"商品背景图"];
    [self addSubview:titleImage];
    [titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(15);
        make.left.equalTo(self.mas_left).offset(13);
        make.width.equalTo(@140);
        make.height.equalTo(@78);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText:@"公司包装设计 / 商标设计 /\nLOGO设计"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.numberOfLines = 0;
    titleLabel.font = Kfont(14);
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(15);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.width.equalTo(@180);
        make.height.equalTo(@35);
    }];
    
    UILabel *nameLabel = [[UILabel alloc] init];
    nameLabel.text = @"森林包装设计";
    nameLabel.textColor = FONTCOLOR_BLACK;
    nameLabel.numberOfLines = 0;
    nameLabel.font = Kfont(12);
    [self addSubview:nameLabel];
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(13);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.width.equalTo(@80);
        make.height.equalTo(@15);
    }];
    
    UILabel *addressLabel = [[UILabel alloc] init];
    addressLabel.text = @"台州";
    addressLabel.textColor = RGB_COLOR(153,153,153);
    addressLabel.numberOfLines = 0;
    addressLabel.font = Kfont(12);
    [self addSubview:addressLabel];
    [addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(nameLabel.mas_top).offset(15);
        make.left.equalTo(titleImage.mas_right).offset(10);
        make.width.equalTo(@80);
        make.height.equalTo(@15);
    }];
    
    UILabel *priceLabel = [[UILabel alloc] init];
    priceLabel.text = @"1200元";
    priceLabel.textAlignment = NSTextAlignmentRight;
    priceLabel.textColor = RGB_COLOR(237,34,59);
    priceLabel.font = Kfont(14);
    [self addSubview:priceLabel];
    [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mas_bottom).offset(-15);
        make.right.equalTo(self.mas_right).offset(-10);
        make.width.equalTo(@70);
        make.height.equalTo(@15);
    }];
    
}

@end
